home *** CD-ROM | disk | FTP | other *** search
/ Apple Media Toolkit 1994 May / AMTK v9.iso / Getting Started / Aldus PageMaker 4.2 / Recipe.script < prev    next >
Encoding:
Text File  |  1991-12-13  |  5.1 KB  |  144 lines  |  [TEXT/MSWD]

  1. -- Script File for use with Aldus PageMaker v4.2
  2.  
  3. --This script must be run from within an entitled publication 
  4.  
  5. --This script creates a new publication, 
  6. --enters text for a cookie recipe and then turns 
  7. --several non-whole numbers in the recipe into 
  8. --correctly-formatted fractions. 
  9. --It also enters instructions on how to use "Fraction.script."
  10.  
  11. -- Begin Script --
  12. --Saves and closes publication
  13.  
  14. save —saves open publication
  15. close  —closes open publication
  16.  
  17. --Creates a new publication
  18. new 1  —creates a new publication with one page
  19. pagesize 8.5i, 11i  -sets page size to letter size
  20.  
  21. --Sets the margins, turns guides & ruler off, sets the view, and centers the window to the desired position
  22. pagemargins 2i, .75i, 2i, 2i  —sets the page margins in inches.
  23. zeropointreset  —set the ruler zero point to it’s default position
  24. guides off —hides rule & column guides
  25. rulers off  —hides rulers
  26. view  100  —changes layout view to actual size
  27. scroll 4.5i, 3.25i  — centers the window on the specified coordinates
  28. redraw on
  29.  
  30. --Draws boxes
  31. box 1.875i, 1i, 6i, 1.5i  — draws a box at the specified coordinates. Left side, top, right side and bottom
  32. fillstyle solid  —fill the box with a solid color
  33. color “Blue”  —applies the color Blue from the color palette to the box.
  34. deselect  —deselects the box
  35. redraw on —refreshes the screen display
  36.  
  37. box 1.875i, 1.5i, 6i, 3.5i
  38. color “Blue”
  39. linestyle onepoint —sets the line weight of the box to 1 point.
  40. fillstyle none  —sets the box fill to none
  41. deselect
  42. redraw on
  43.  
  44.  
  45. --Creates a new story and enter the cookie recipe
  46. newstory 2i, 1.25i —Creates a new text block. 
  47.  
  48. --The next command enters the text for the Cookie Recipe
  49. textenter “Chocolate Chip Cookies
  50. 2 cups of flour
  51. 1-1/2 cups brown sugar
  52. 1/2 cup sugar
  53. 1 cup butter
  54. 2 eggs
  55. 1 teaspoon of vanilla
  56. 1 teaspoon of baking soda
  57. 1 16-ounce bag of chocolate chips”
  58. redraw on
  59.  
  60. --Changes font to Helvetica and changes the size of both the title and text.
  61. textcursor -story —moves the cursor to the beginning of the story
  62. textselect +eol  —selects the text of the first line
  63. size 24  —changes the type size to 24 points
  64. typestyle bold —changes the typestyle to bold
  65. typestyle reverse  —reverses the type, changing the selected type’s color to “Paper” 
  66. paraspace 0, 0p4 —adds 4 points of space after the selected paragraph
  67. textcursor +char —moves the text cursor 1 character
  68. redraw on
  69. textselect +story  —selects text from the text cursor to the end of the story
  70. size 14  —changes the selected type to 14 points
  71. redraw on
  72. selectall —selects the entire story
  73. font “Helvetica” —changes the selected text to “Helvetica”
  74. redraw on
  75.  
  76. --Moves the cursor into position to format the first fraction
  77. textcursor -story —moves the cursor to the beginning of the story
  78. textcursor +para  —moves the text cursor ahead one paragraph
  79. textcursor +eol  —moves the text cursor to the end line its on
  80. textcursor +char  —moves the text cursor ahead one character
  81. textcursor + word  —moves the text cursor ahead one word
  82. textcursor + word
  83. textcursor + word
  84. textcursor + word
  85. textcursor + word
  86. textcursor -char  —moves the text cursor back one character
  87.  
  88. --Formats the first fraction
  89. textselect -word   —selects the word to the left of the text cursor 
  90. typeoptions 80,58,33,0  —sets the small caps size (80% of normal), Super/subscript size (58% of normal), superscript postion (33% of type size above the baseline), and subscript position (0% or right on the baseline)
  91. position subscript —sets the denominator to specified subscript position
  92. textcursor -char 
  93. textselect +char
  94. textenter “⁄” —changes the regular slash ‘/’ to an option-shift-1 slash for better looking fraction
  95. textcursor -char 
  96. textselect -word
  97. typeoptions 80,58,33,0
  98. position superscript  —sets the numerator to specified superscript position
  99. textcursor +word
  100. textcursor +word
  101. position normal
  102. redraw on
  103.  
  104. --Positions cursor for formatting second fraction
  105. textcursor +eol
  106. textcursor +char
  107. textcursor + word
  108. textcursor + word
  109. textcursor + word
  110. textcursor -char
  111.  
  112. --Formats second fraction
  113. textselect -word
  114. typeoptions 80,58,33,0 
  115. position subscript
  116. textcursor -char
  117. textselect 0
  118. textenter “⁄”
  119. textcursor -char
  120. textselect -word
  121. typeoptions 80,58,33,0
  122. position superscript
  123. textcursor +word
  124. textcursor +word
  125. position normal
  126. deselect
  127. redraw on
  128.  
  129.  
  130. pagemargins .75i, .75i, .75i, .75i —changes the page margins for new text block
  131. newstory 2i, 4i
  132. font “Times”
  133. size 12
  134. paraspace 0p6, 0
  135. textenter “This is an example of the way scripts can be used to automate time-consuming tasks.
  136. One of the tasks automated in this example is the formatting of fractions to enhance their appearance.  
  137. A script for formatting fractions has been included with PageMaker 4.2. This script substitutes a non-breaking fraction slash for a standard slash, then changes the numerator to a superscript character and the denominator to a subscript character. To try it insert the text cursor just to the right of the fraction below (do not highlight the fraction), then choose \“Run Script...\” from the \“Aldus Additions\” menu, select \“Fraction.Script,\” and click on the \“Run File\” button. 
  138.  
  139. Size 24
  140. alignment center —sets alignment of paragraph to centered
  141. textenter “12/256”
  142. redraw on
  143.